package com.shirley.pers.zhufengfmvi.entities;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Description: 发现新奇List<br/>
 * <p/>
 * Copyright (c) , 2016, Shirley Xian <br/>
 * This program is protected by copyright laws. <br/>
 * ClassName: DiscoveryColumnsList<br/>
 * Date: 2016/4/7 15:54
 *
 * @author Shirley Xian
 * @version 1.0
 */
public class DiscoveryColumnsList extends DiscoveryRecommendItem {
    private List<DiscoveryColumnsListInfo> mList;

    public void parseJson(JSONObject jsonObject) throws JSONException {
        if (jsonObject != null) {
            super.parseJson(jsonObject);
            JSONArray array = jsonObject.getJSONArray("list");
            mList = new ArrayList<>();
            for (int i = 0; i < array.length(); i++) {
                JSONObject jo = array.getJSONObject(i);
                DiscoveryColumnsListInfo discoveryColumnsListInfo = new DiscoveryColumnsListInfo();
                discoveryColumnsListInfo.parseJson(jo);
                mList.add(discoveryColumnsListInfo);
            }
        }
    }

    public List<DiscoveryColumnsListInfo> getList() {
        return mList;
    }
}
